home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 August: Tool Chest / Dev.CD Aug 94.toast / New System Software Extensions / OpenDoc A6 / OpenDoc Parts Framework / OPF / Found / FWCommon / Include / FWPriMem.h < prev    next >
Encoding:
Text File  |  1994-04-21  |  1.9 KB  |  53 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWPriMem.h
  4. //    Release Version:    $ 1.0d1 $
  5. //
  6. //    Creation Date:        3/25/94
  7. //
  8. //    Copyright:    © 1994 by Apple Computer, Inc., all rights reserved.
  9. //
  10. //========================================================================================
  11.  
  12. #ifndef FWPRIMEM_H
  13. #define FWPRIMEM_H
  14.  
  15. #include <stddef.h>
  16.  
  17. //----------------------------------------------------------------------------------------
  18. // Primitive Memory Operations
  19. //
  20. //    These functions provide a platform-independent interface to low level operating
  21. //    system services for memory management.  The functions impose minimal requirements
  22. //    on the underlying environment, and are built in the simplest way on top of native
  23. //    operating system APIs.
  24. //
  25. //    Memory blocks allocated and freed by these functions can be as large as can be
  26. //    requested with a size_t parameter, but these routines should generally not be
  27. //    used for large allocations.
  28. //
  29. //    This function are intended for use by very low-level code.  Applications (and most
  30. //    of OPF) should use higher level interfaces.
  31. //
  32. //----------------------------------------------------------------------------------------
  33.  
  34. void *FW_PrimitiveAllocateBlock(size_t bytesRequested);
  35.     // Returns 0 if request could not be satisfied.
  36.     
  37. void *FW_PrimitiveResizeBlock(void *block, size_t bytesRequested);
  38.     // The block may be moved to satisfy request.
  39.     // Returns 0 if request could not be satisfied.
  40.     // Resize of NULL or invalid block is undefined (platform-dependent).
  41.     
  42. void  FW_PrimitiveFreeBlock(void *block);
  43.     // Free of invalid block is undefined (platform-dependent).
  44.     // It is a no-op to try to free NULL.
  45.  
  46. size_t FW_PrimitiveGetBlockSize(void* p);
  47.     // Returns size in bytes.
  48.     // Size of NULL or invalid block is undefined (platform-dependent).
  49.  
  50. void FW_PrimitiveCopyMemory(const void *source, void *destination, size_t bytes);
  51.     // No error detection provided
  52.     
  53. #endif